<!DOCTYPE html>
<html class="pixel-ratio-3 retina android android-5 android-5-1-1">
<head>
    <title>问诊单</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="description" content="">

    <link rel="stylesheet" href="/lib/weui.min.css">
    <link rel="stylesheet" href="/css/jquery-weui.css">
    <link rel="stylesheet" href="/plugins/fontaw/css/font-awesome.css">
    <link rel="stylesheet" href="/css/home.css">
<style>
    .border-1px{ border-right: 1px solid rgba(0,0,0,.1);}
    .guaid-title{ display: block;}
    .guaid-num{ display: block;font-size: 2.1em;color: #0d0d0d}
    .right-link{float:right;clear: both}
    .right-link a{color:darkred}
    .red-border{border: darkred solid 1px;color:darkred;font-size: 10px;border-radius: 3px;padding:2px 3px;vertical-align: middle}
    .weui-panel__bd{font-size:0.8rem}
    .inquir-temp{padding:0.3rem}
    .item_block{
        width:100%;height: 5rem;border:lightgray solid 0.03rem; border-radius: 3%;margin-top: 0.3rem ;
        text-align: center;font-size: 0.6rem;color: grey;
    }
    .item_block h3{padding:0.3rem}
    .item_block p{padding:0.3rem}
    .inner-btn{padding:0.3rem 0.5rem; background-color: lightgray;border-radius: 5%;color: #0D0D0D}
    .shareMask{display: none;width: 100%;height:100%;background-color: rgba(0,0,0,.7);position:absolute;top:0px;text-align: center}
    .shareMask img{width: 100%}
    .block_selected{background-color: rgba(205,246,27,.3)}
</style>
</head>
<body ontouchstart>
<div class="weui-flex">
    <div class="weui-flex__item">
        <div class="weui-panel__ft">
            <a href="../studio/inquiry-recieved.html" id="listLink" class="weui-cell weui-cell_access weui-cell_link" >
                <div class="weui-cell__bd">
                    <i class="fa fa-file-word-o" aria-hidden="true"></i>
                    <span>我的问诊单</span>
                </div>
                <span class="weui-cell__ft" id="inquiryCount"></span>
            </a>
        </div>
    </div>
</div>

<div class="weui-panel">
    <div class="weui-panel__hd">问诊单模板</div>
    <div class="weui-panel__bd">
        <div class="weui-flex">
            <div class="weui-flex__item  inquir-temp" >
                <div class="item_block">
                    <h3>问诊单成人女</h3>
                    <p>43题</p>
                    <a href="javascript:;" class="inner-btn wcShare" inquryId="23">使用模板</a>
                </div>
            </div>
            <div class="weui-flex__item inquir-temp">
                <div class="item_block">
                    <h3>问诊单成人男</h3>
                    <p>33题</p>
                    <a href="javascript:;" class="inner-btn wcShare" inquryId="25">使用模板</a>
                </div>
            </div>
            <div class="weui-flex__item inquir-temp">
                <div class="item_block">
                    <h3>问诊单小儿</h3>
                    <p>17题</p>
                    <a href="javascript:;" class="inner-btn wcShare" inquryId="38">使用模板</a>
                </div>
            </div>
        </div>
    </div>
</div>

<div class="shareMask">
    <img src="/mod-page/images/wechat/sharetip.png">
    <a href="javascript:;" id="kownBtn" style="font-size:1.2rem"><span> 我知道了</span> </a>
</div>

<script src="/lib/jquery-2.1.4.js"></script>
<script src="/lib/fastclick.js"></script>
<script src="/js/jquery-weui.js"></script>
<script src="/js/home.js"></script>
<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js" charset="utf-8"></script>

<script>
   var jflag = getQueryString("jflag");
   var doctorId = getQueryString("doctorId");
   initConfig();
   function initConfig(){
       $.ajax({
           url:"/wechat/jsconfig",
           dataType:"json",
           data:{"vurl":location.href},
           success:function(da){
               wx.config({
                   debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
                   appId: da.data.appId, // 必填，公众号的唯一标识
                   timestamp: da.data.timestamp, // 必填，生成签名的时间戳
                   nonceStr: da.data.nonceStr, // 必填，生成签名的随机串
                   signature: da.data.signature,// 必填，签名
                   jsApiList: ["chooseImage","previewImage","uploadImage","onMenuShareAppMessage"] // 必填，需要使用的JS接口列表
               });
           }
       });
   }

    $(function(){
        var doctorId = getQueryString("doctorId");
       var data = {"doctorId":doctorId};       // 模拟数据
       $.ajax({
           url:"/inquiry/getCountByDoctorId",
           type:"post",
           dataType:"json",
           data:data,
           success:function(result){
                //alert("成功");
               $("#listLink").attr("href","../studio/inquiry-recieved.html?doctorId="+doctorId);
                console.log(result.msg);
                $("#inquiryCount").html(result.data+"份");
           },error:function(){
                //alert("失败");
           }
       });

    });

   var configOK= false;

    $(".wcShare").click(function(){
        $(".item_block").removeClass("block_selected");
        $(this).parent().addClass("block_selected");
        var inquryId = $(this).attr("inquryId");
        if(!configOK){
            wx.onMenuShareAppMessage({
                title: '问诊单', // 分享标题
                desc: '医生给你发来了问诊单', // 分享描述
                link: serverAdd+'/mod-page/studio/transform.html?doctorId='+doctorId+'&inquryId'+inquryId, // 分享链接，该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
                imgUrl: serverAdd+'/mod-page/images/wechat/logo-s1.png', // 分享图标
                type: 'link', // 分享类型,music、video或link，不填默认为link
                dataUrl: '', // 如果type是music或video，则要提供数据链接，默认为空
                success: function () {
                    $(".shareMask").hide();
                }
            });
            configOK = true;
        }

       $(".shareMask").show();
    });

    $("#kownBtn").click(function(){
       $(".shareMask").hide();
    });

</script>
</body>
</html>